Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I5415f4f1804a85a04ff6396d71b7a61b230e1685
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/6686
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit
0274803ae273fa6bdbd1124cedf37395ce847148)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208193
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Reviewed-by: Hossein <hossein@libreoffice.org>
Gbp-Pq: Name do-not-load-exotic-protocols-for-document-supplied-data.diff
#include <rtl/ustring.hxx>
#include <rtl/ustrbuf.hxx>
+#include <sal/log.hxx>
#include <tools/debug.hxx>
+#include <tools/urlobj.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/servicehelper.hxx>
if( sURL.isEmpty() )
return;
+ if( INetURLObject( sURL ).IsExoticProtocol() )
+ {
+ SAL_WARN("forms.xforms", "Model::loadInstance: blocked exotic protocol: \"" << sURL << "\"");
+ return;
+ }
+
try
{
Reference<XInputStream> xInput =
bHasResult = false;
INetURLObject aURLObject(aURL);
+ if (aURLObject.IsExoticProtocol())
+ {
+ SAL_WARN("sc.ui",
+ "ScWebServiceLink::DataChanged: blocked exotic protocol: \"" << aURL << "\"");
+ return ERROR_GENERAL;
+ }
+
const OUString sHost = aURLObject.GetHost();
if (HostFilter::isForbidden(sHost))
{
#include <unotools/charclass.hxx>
#include <tools/stream.hxx>
#include <comphelper/processfactory.hxx>
+#include <tools/urlobj.hxx>
#include "htmldataprovider.hxx"
#include "xmldataprovider.hxx"
std::unique_ptr<SvStream> DataProvider::FetchStreamFromURL(const OUString& rURL, OStringBuffer& rBuffer)
{
+ INetURLObject aURLObject(rURL);
+ if (aURLObject.IsExoticProtocol())
+ {
+ SAL_WARN("sc.ui", "DataProvider::FetchStreamFromURL: blocked exotic protocol: \"" << rURL << "\"");
+ return nullptr;
+ }
+
try
{
uno::Reference< ucb::XSimpleFileAccess3 > xFileAccess = ucb::SimpleFileAccess::create( comphelper::getProcessComponentContext() );
#include "sqldataprovider.hxx"
#include <datatransformation.hxx>
+#include <sal/log.hxx>
+#include <tools/urlobj.hxx>
#include <salhelper/thread.hxx>
#include <com/sun/star/sdb/DatabaseContext.hpp>
#include <com/sun/star/sdb/XCompletedConnection.hpp>
OUString aTable = maID.copy(0, nIndex);
OUString aDatabase = maID.copy(nIndex + 1);
+ if (INetURLObject(aDatabase).IsExoticProtocol())
+ {
+ SAL_WARN("sc.ui",
+ "SQLFetchThread::execute: blocked exotic protocol: \"" << aDatabase << "\"");
+ return;
+ }
+
try
{
uno::Reference<sdb::XDatabaseContext> xContext